package net.oschina.foodon.examples.spring.boot.amqp.producer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试RabbitMQ发送消息的Controller
 * Created by foodon on 2017/4/12.
 */
@RestController
public class MessageController {

    @Autowired
    private MessageSender messageSender;

    /**
     * 向消息队列1中发送消息
     *
     * @param msg 传进来的消息
     */
    @RequestMapping("send1")
    public void send1(String msg) {
        messageSender.send1(msg);
    }

    /**
     * 向消息队列2中发送消息
     *
     * @param msg 传进来的消息
     */
    @RequestMapping("send2")
    public void send2(String msg) {
        messageSender.send2(msg);
    }
}
